package com.enjoyor.soa.traffic.frame.support.kafka.template;

import java.util.Date;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.enjoyor.soa.traffic.frame.support.kafka.message.KafkaMessage;
import com.enjoyor.soa.traffic.frame.support.kafka.message.KafkaMessageHeader;
import com.enjoyor.soa.traffic.frame.support.kafka.message.MessageType;
import com.enjoyor.soa.traffic.frame.support.kafka.send.IKafkaSendTool;

@Component
public class KafkaSenderTemplate {

    @Autowired
    private IKafkaSendTool kafkaSendTool;

    public void send() {
        KafkaMessage kafkaMessage = new KafkaMessage(new KafkaMessageHeader(UUID.randomUUID().toString(), "Template",
                new Date(), MessageType.TEMPLATE.toString()), "Template Sender Msg");
        kafkaSendTool.send("template", kafkaMessage);
    }

}
